package com.xiao.demo01;

//编程的一个原则，优先用组合，而后用继承
public class Proxy1 implements Rent{
    private Host host;

    public Proxy1() {
    }

    public Proxy1(Host host) {
        this.host = host;
    }


    public void rent() {
        System.out.println("我是中介，我帮忙代理出租房子");
        host.rent();
        seeHouse();
        sign();
        fee();
    }
    //看房
    public void seeHouse(){
        System.out.println("中介带着你看房子！");
    }

    //签合同
    public void sign(){
        System.out.println("你要和中介签署租赁合同！");
    }

    //收费用
    public void fee(){
        System.out.println("中介要收取你费用！");
    }

}
